package gob.osinerg.emergencia.tag;

public class RadioControl extends GenericControl{
	
	private boolean checked=false;

	
	public RadioControl() {
		setType("radio");
		setControl("input");
	}
	
	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<td colspan=\"2\">");
		openTag(sb);
		sb = getHtml(sb);
		prepareAttribute(sb, "checked", getChecked() ? "checked" : null);
		closeTag(sb);
		sb.append(getLabel());
		sb.append("</td>");
		return sb.toString();
	}

	public static void main(String[] args) {
		RadioControl rc = new RadioControl();
		rc.setName("opcion");
		rc.setChecked(true);
		System.out.println(rc.toString());
	}

	public boolean getChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}


	
}
